<template>
    <div>
        <el-card>
            <ReturnPage></ReturnPage>
            <!-- 头部功能区 -->
            <el-row>
                <el-form inline>
                    <!-- 新增搜索 -->
                    <el-form-item>
                        <el-input placeholder="请输入名称"
                                  size="mini" />
                    </el-form-item>
                    <el-form-item>
                        <el-select v-model="value"
                                   placeholder="请选择状态"
                                   size="mini">
                            <el-option v-for="item in options"
                                       :key="item.value"
                                       :label="item.label"
                                       :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item>
                        <el-select v-model="value"
                                   style="margin-left:10px"
                                   placeholder="请选择严重性"
                                   size="mini">
                            <el-option v-for="item in options1"
                                       :key="item.value"
                                       :label="item.label"
                                       :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary"
                                   icon="el-icon-search"
                                   style="margin-left:10px"
                                   size="mini">搜索</el-button>
                        <el-button type="primary"
                                   size="mini"
                                   @click="addtrigger()">创建触发器</el-button>
                    </el-form-item>
                </el-form>
            </el-row>
            <!-- 编辑弹框 -->
            <el-dialog title="编辑">
                <el-form ref="editForm">
                    <el-form-item label="备注"
                                  prop="remarsk"
                                  label-width="100px">
                        <el-input autocomplete="off"
                                  placeholder="请输入备注信息"></el-input>
                    </el-form-item>
                </el-form>
                <div slot="footer"
                     class="dialog-footer">
                    <el-button>取 消</el-button>
                    <el-button type="primary">确定</el-button>
                </div>
            </el-dialog>
            <!-- 列表 -->
            <el-row>
                <el-table :data="tableData"
                          style="width: 100%"
                          height="calc(100vh - 250px)"
                          :cell-style="cellStyle"
                          :default-sort="{ prop: 'date', order: 'descending' }"
                          @row-click="rowClick">
                    <el-table-column show-overflow-tooltip="ture"
                                     prop="seriousness"
                                     label="严重性"
                                     align="center">
                        <template slot-scope="scope">
                            <el-tag type="primary">{{ scope.row.seriousness }}</el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column show-overflow-tooltip="ture"
                                     prop="name"
                                     align="center"
                                     label="名称">
                        <template slot-scope="scope">
                            <el-tag type="success">{{ scope.row.name }}</el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column show-overflow-tooltip="ture"
                                     prop="expression"
                                     align="center"
                                     label="表达式">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip="ture"
                                     prop="status"
                                     align="center"
                                     label="状态">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip="ture"
                                     prop="mark"
                                     align="center"
                                     label="标记">
                    </el-table-column>
                </el-table>
            </el-row>
        </el-card>
    </div>
</template>
<script>
    export default {
        data () {
            return {
                options: [{
                    value: 1,
                    label: '已启用'
                }, {
                    value: 2,
                    label: '已停用'
                },],
                options1: [{
                    value: 1,
                    label: '未分类'
                }, {
                    value: 2,
                    label: '警告'
                },
                {
                    value: 3,
                    label: '严重'
                },
                {
                    value: 4,
                    label: '信息'
                },
                {
                    value: 5,
                    label: '一般严重'
                },
                {
                    value: 6,
                    label: '灾难'
                },
                ],
                //列表数据
                tableData: [
                    {
                        seriousness: '严重',
                        name: "/etc/passwd has been changed",
                        expression: 'last(/AIX by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#1)<>last(/AIX by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#2)',
                        status: '已启用',
                        mark: 'component: memory'
                    },
                    {
                        seriousness: '严重',
                        name: "/etc/passwd has been changed",
                        expression: 'last(/AIX by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#1)<>last(/AIX by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#2)',
                        status: '已启用',
                        mark: 'component: memory'
                    },
                ],

            };
        },
        methods: {
            //创建触发器
            addtrigger () {
                this.$router.push({
                    path: "Addtrigger",
                });
            }

        },
        created () { },
        computed: {},
    };
</script>
<style lang="scss" scoped></style>
